From: Jan Beulich Date: Wed, 9 Mar 2011 16:14:59 +0000 (+0000) Subject: x86: don't BUG() post-boot in alloc_xen_pagetable() X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=be68c24351805ab7840ba13c6ac89dc1fc3e58f5;p=xen.git x86: don't BUG() post-boot in alloc_xen_pagetable() Instead, propagate the condition to the caller, all of which also get adjusted to check for that situation. Signed-off-by: Jan Beulich --- diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 84044d1931..b31b4bbe4b 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -5141,8 +5141,11 @@ int map_pages_to_xen( while ( nr_mfns != 0 ) { #ifdef __x86_64__ - l3_pgentry_t *pl3e = virt_to_xen_l3e(virt); - l3_pgentry_t ol3e = *pl3e; + l3_pgentry_t ol3e, *pl3e = virt_to_xen_l3e(virt); + + if ( !pl3e ) + return -ENOMEM; + ol3e = *pl3e; if ( cpu_has_page1gb && !(((virt >> PAGE_SHIFT) | mfn) & @@ -5262,6 +5265,8 @@ int map_pages_to_xen( #endif pl2e = virt_to_xen_l2e(virt); + if ( !pl2e ) + return -ENOMEM; if ( ((((virt>>PAGE_SHIFT) | mfn) & ((1<= (1<